package net.homelinux.chaoswg.io.renga.krypto.converter;

import net.homelinux.chaoswg.io.higherorderfunctions.AbstractUnaryFunction;
import net.homelinux.chaoswg.io.renga.core.converter.Converter;
import net.homelinux.chaoswg.io.renga.krypto.datatypes.numerical.UnsignedNBit;
import net.homelinux.chaoswg.io.renga.krypto.datatypes.vectors.BitVector;

public class StringToBVConverter extends AbstractUnaryFunction<BitVector, String> implements Converter<BitVector, String> {
    private final Converter<UnsignedNBit, String> s2unb = new StringToUNBConverter ();
    private final Converter<BitVector, UnsignedNBit> unb2bv = new UNBtoBVConverter (); 
     
    public BitVector apply(final String arg0) throws IllegalArgumentException {
        final UnsignedNBit result = s2unb.apply(arg0);
        
        return unb2bv.apply(result);
    }

}
